package com.lm56.web.sys.mapper;

import com.lm56.web.network.domain.Location;
import com.lm56.web.network.domain.ShippingType;
import com.lm56.web.sys.domain.User;
import com.lm56.web.sys.domain.UserContact;
import com.lm56.web.sys.domain.UserDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;

import java.util.List;

/**
 * Created by Kelvin Yeung on 2016/9/21.
 */


public interface UserMapper {


    @Result
    List<User> getAllUsers();

    @Result
    User getUserById(long id);

    @Result
    User getUserByPhoneNo(String phoneNo);

    @Result
    User getUserByEmail(String email);

    @Result
    UserDetail getUserDetailById(long id);

    @Result
    UserDetail getUserDetailByPhoneNo(String phoneNo);

    List<User> getAllCompanies();

    void insertUser(UserDetail userDetail);

    void insertUserContacts(List<UserContact> contactList);


    void addUser(UserDetail userDetail);

    void updateUser(User user);

    void updateUserDetail(UserDetail userdetail);

    void deleteUserById(long id);


    void insertShippingTypeForCompany(@Param("userId") Long userId, @Param("list") List<ShippingType> shippingTypes);

    void deleteRegularLinesByUserId(@Param("userId") Long userId);
    void  insertRegularLines(@Param("userId") Long userId,@Param("list") List<Location> regularLines);
    void deleteUserContact(@Param("userId") Long userId);

    void deleteShippingTypesForCompany(@Param("userId") Long userId);

}
